package cn.lk.netty.rpc.controller;

import cn.lk.netty.rpc.bean.InfoUser;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.UUID;

/**
 * @ClassName IndexController
 * @Deseription TODO
 * @Author hu'nan
 * @Date 2020/4/5 17:21
 * @Version 1.0
 **/
@Controller
public class IndexController {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @RequestMapping("index")
    @ResponseBody
    public String index(){
        InfoUser user = new InfoUser(UUID.randomUUID().toString(),"王思萌","BeiJing");
        String json = JSONObject.toJSONString(user);
        logger.info(json);
        return json;
    }
}
